import axios from '../utils/request'
// 请求商品列表接口
const fetchItems = (params = {}) => axios.get('/api/getItemList', { params })

// 增加商品接口
const addItem = (params = {}) => axios.post('/api/addItem', params)

// 获取商品详情
const fetchDetail = (id) => axios.get('/api/getArt',
  {
    params: {
      id
    }
  })
// 更新商品
const updateItem = (params = {}) => axios.post('/api/updateItem', params)
// 删除商品
const delItem = (id) => axios.get('/api/delItem',
  {
    params: {
      id
    }
  })
// 用户登录
const doLogin = (params = {}) => axios.post('/api/login', params)
export {
  fetchItems,
  addItem,
  fetchDetail,
  updateItem,
  delItem,
  doLogin
}